<template>
    <div>
        <van-card class="m-goods-card" v-for="(item,index) in goodslist" 
            :key="index" 
            :num="(item.num)" 
            :title="(item.title)"
            :desc="(item.desc)"
            :price="(item.price)"
            :tag="(item.tag)"
            :thumb="(item.thumb)"
            :origin-price="(item.orgprice)"
            @click="onClick(item.id)" >
            <template #tags >
                <div v-for="(mtag) in item.tags" style="float:left">
                    <van-tag plain  >{{mtag}}</van-tag>
                </div>
            </template>
        </van-card>
    </div>
</template>
<script>
export default {
    data(){
        return{
            goodslist:[
                {
                    id:"0",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"1",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"2",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    tags:["001","002","003"],
                },
                {
                    id:"3",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"4",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
               {
                    id:"5",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"6",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"7",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"8",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"9",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"10",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"11",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"12",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"13",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
                {
                    id:"14",
                    tag:"标签",
                    price:"2.00",
                    desc:"描述信息",
                    title:"商品标题",
                    thumb:"https://img.yzcdn.cn/vant/ipad.jpeg",
                    orgprice:"10.00",
                    tags:["001","002","003"],
                },
            ],
        };
    },
    methods:{
        onClick(index,e){
            console.log("goodsId---------",index);
            this.$router.push({path:"/GoodsManager/GoodsInfos/GoodsInfos",query:{id:index}})
        },
    }
}
</script>
<style scoped>
.m-goods-card{
    margin-bottom:"60px";
}
</style>